c     include file for 'cst.for'
c	  declares array dimensions and common variables and arrays.
c	  ming ye, july 21, 2009
c
c	  parameters set by:
c	  sg = setgrid
c	  m = main program
c     1 = candd
c	  2 = w_prop
c	  3 = shelfqs
c	  4 = exner
c	  5 = shoreln
c-----------------------------------------------------------------------
c parameters controlling static dimensioning of cst:
c
c	  max_i  number of grid cells in the shore parallel direction(sg)
c	  max_j	number of grid cells in the cross-shore direction(sg)	
c	  max_t	integer count of the time steps	(m)
c-----------------------------------------------------------------------
c
c user adjustable array dimensions:
c
      parameter(max_i=150,max_j=150,max_t=50)
c
c  arrays:
c
	integer jshore(max_i)				!jshore(i) - most landward ocean cell - surf-zone cell(sg)
	real a(max_i,max_j),				!a(i,j) - angle between flow and grid coordinates {sg}
     +     ab(max_i),					!ab(i) - breaker angle {2}
     +     aw(max_i,max_j),				!aw(i,j) - angle between wave propagation & onshore direction {2}
     +     ccstar(150),
     +     cstar(max_i,max_j),			!cstar(i,j,it) - time-,& depth-averaged entrained sed.concentration {1}
     +     dc(max_i,max_j),				!dc(i,j) - cross-shore diff. coef.in flow coords.{1}
     +     dl(max_i,max_j),				!dl(i,j) - longshore diff. coef.in flow coords. {1}
     +     h(max_i,max_j),				!h(i,j,max_t) - depths in grid, fill index in surf-zone cells {sg}     
     +     hcs(150),
     +     hold(150),
     +     hseries(max_i,max_j,max_t),
     +	   qlit(max_i),					!qlit(i) - mass of sediment transport in the shoreline cell
     +	   qxrt(max_i,max_j),			!qxrt(i,j,max_t) - x-direction time-,& depth-averaged sed. trans.{3}
     +     qyup(max_i,max_j),			!qyup(i,j,max_t) - y-direction time-,& depth-averaged sed, trans.{3}
     +	   sangle(max_i),				!sangle(i) - - tangent angle along the shoreline (between the tangent line and the negative x direction	{sg}
     +     shoal(max_i),				!shoal(i) - relative convergence/div of wave-energy density due to refraction	{2}
     +     slope(150),
     +	   sxser(150,50),
     +     syser(max_i,max_t),	
     +     yoff(max_i),					!yoff(i,max_t) - offset between the surf-zone cell center and the 
										!continuous shoreline (can be positive or negative){sg}
     +	   xshore(max_i),				!xshore(i) - x-coord. of the continuous shoreline {sg}
     +     yshore(max_i)				!yshore(i) - y-coord. of the continuous shoreline {sg}
c
c --- standard common blocks ---
c	
	 common /shore/jshore,yoff,xshore,yshore,sangle
	 common /dgrid/h,a,hold
	 common /c_d_para/cstar,ccstar,dc,dl,hcs,jlimit
	 common /wave_para/shoal,ab,aw	 
	 common /surfzone_shelf_para/qxrt,qlit,qyup

c
c fixed parameters
c
c	acent - angle of wave climate central tendency (0 is for crests parallel to the lower boundary)
c	astorm - angle of dominant waves 
c	beta - scales the exponent in the wave-drift
c	ck - coef.scales rate of gravity-driven upper shoreface sed flux (3) 
c	deltax -  longshore grid cell dimension (sg)
c	deltay - cross-shore grid cell dimension (sg)
c	dcyyy - controls the slope of the cross-shore diffusion coef.
c             when it is computed from a linear eqn. 
c	dczero - the offset in the above relationship 
c	dcmax - max. limit for the cross-shore diff. coef. 
c	dlyyy - slope of the longshore diff. coef.    
c	dlzero - offset of the above.			
c	dlmax - max. limit for the long-shore diff. coef.
c	dt - time step in years
c	edfact - controls relative converge/divergence of waves due
c	         to refraction (should mimic rfact)
c	gfact - factor for the k(cn)/(delrho)ga in the ls transp.eqn.
c	hmax - max.(ie. most negative) depth in the surf zone cell (sg)
c	hmin - min. depth in the surf zone cell	 (sg)
c	htop - top elevation used for shoreln4
c	hbot - bottom elevation used for shoreln4s
c	hwave_max - the maximum depth (e.g., -30m) below which wave refraction does not make much difference 
c	hwave_min - the time-averaged minimum breaker depth (e.g., -3m) above which the wave angle is the same as the breaker angle
c            between hw_max and hw_min, refraction acts as an exponential function of water depth
c	k1 - scales the diff. sed. transport
c	mfact - scales the wave-energy density of general wave climate
c	nfact - scales the wave-energy density of the dominant waves
c	pore - sediment porosity
c	scr - the critical slope of the upper shoreface cell (jshore-1)
c	rfact - contols the relative ray-bending due to refraction
c	wo - scales the wave-drift sed. trans.
c

      integer imax,jmax,itmax,nnsave,iriv
      real htop,hbot,aa,const,deltax,deltay
      real acent,astorm,beta,coef,dcyyy,dczero,dcmax,dlyyy,
     +     dlzero,dlmax,dt,edfact,gfact,hwave_max,hwave_min,k1,k2,mfact,
     +     nfact,pore,scr,rfact,wo,qriv 
     
      common /grid_para/imax,jmax,htop,hbot,aa,const,deltax,deltay
      common /para/acent,astorm,beta,coef,dcyyy,dczero,dcmax,dlyyy,
     +             dlzero,dlmax,dt,edfact,gfact,itmax,k1,k2,mfact,
     +             nfact,nnsave,pore,scr,rfact,wo,qriv,iriv      
